// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    a1:3,
    a2:3,
    a3:3,
    a4:3,
    a5:3,
    a6:3,
    a7:3,
    source1:true,
    source2:true,
    source3:true,
    source4:true,
    source5:true,
    source6:true,
    source7:true,
    flag1: false,
    flag2: false,

    items: [
      { name: 'CHN', value: '中国', checked: 'true' },
    ]
  },

    // 选择框
    checkboxChange1: function (e) {
      console.log('checkbox发生change事件，携带value值为：', e.detail.value)
      if(e.detail.value.length>0){
        this.setData({
          a1: this.data.a1 + 1
        })
      }else{
        this.setData({
          a1: this.data.a1 -1
        })
      }
    },
    checkboxChange2: function (e) {
      console.log('checkbox发生change事件，携带value值为：', e.detail.value)
      if(e.detail.value.length>0){
        this.setData({
          a2: this.data.a2 + 1
        })
      }else{
        this.setData({
          a2: this.data.a2 -1
        })
      }
    },

    checkboxChange3: function (e) {
      console.log('checkbox发生change事件，携带value值为：', e.detail.value)
      if(e.detail.value.length>0){
        this.setData({
          a3: this.data.a3 + 1
        })
      }else{
        this.setData({
          a3: this.data.a3 -1
        })
      }
    },
    checkboxChange4: function (e) {
      console.log('checkbox发生change事件，携带value值为：', e.detail.value)
      if(e.detail.value.length>0){
        this.setData({
          a4: this.data.a4 + 1
        })
      }else{
        this.setData({
          a4: this.data.a4 -1
        })
      }
    },
    checkboxChange5: function (e) {
      console.log('checkbox发生change事件，携带value值为：', e.detail.value)
      if(e.detail.value.length>0){
        this.setData({
          a5: this.data.a5 + 1
        })
      }else{
        this.setData({
          a5: this.data.a5 -1
        })
      }
    },

    checkboxChange6: function (e) {
      console.log('checkbox发生change事件，携带value值为：', e.detail.value)
      if(e.detail.value.length>0){
        this.setData({
          a6: this.data.a6 + 1
        })
      }else{
        this.setData({
          a6: this.data.a6 -1
        })
      }
    },
    checkboxChange7: function (e) {
      console.log('checkbox发生change事件，携带value值为：', e.detail.value)
      if(e.detail.value.length>0){
        this.setData({
          a7: this.data.a7 + 1
        })
      }else{
        this.setData({
          a7: this.data.a7 -1
        })
      }
    },

  
  btnOneAction(){
    console.log('点击了婚宴场地')
      this.setData({
        source1:false,
        flag1:true
      })
  },
  btnTwoAction(){
    console.log('点击了求婚戒指')
      this.setData({
        source2:false,

        flag2:true
      })
  },
  btnThreeAction(){
    console.log('点击了婚纱拍照')
      this.setData({
        source3:false,

        flag3:true
      })
  },
  btnFourAction(){
    console.log('点击了婚礼策划')
      this.setData({
        source4:false,

        flag4:true
      })
  },
  btnFiveAction(){
    console.log('点击了婚礼礼服')
      this.setData({
        source5:false,

        flag5:true
      })
  },
  btnSixAction(){
    console.log('点击了婚礼物资')
      this.setData({
        source6:false,

        flag6:true
      })
  },
  btnSievenAction(){
    console.log('点击了婚礼事物')
      this.setData({
        source7:false,

        flag7:true
      })
  },

  tap1(){
    console.log('第二次点击')
    this.setData({
      source1:true,
      flag1: false
    })
  },
  tap2(){
    console.log('第二次点击')
    this.setData({
      source2:true,

      flag2: false
    })
  },
  tap3(){
    console.log('第二次点击')
    this.setData({
      source3:true,

      flag3: false
    })
  },
  tap4(){
    console.log('第二次点击')
    this.setData({
      source4:true,

      flag4: false
    })
  },
  tap5(){
    console.log('第二次点击')
    this.setData({
      source5:true,

      flag5: false
    })
  },
  tap6(){
    console.log('第二次点击')
    this.setData({
      source6:true,

      flag6: false
    })
  },
  tap7(){
    console.log('第二次点击')
    this.setData({
      source7:true,

      flag7: false
    })
  },

  onLoad() {
    if (wx.getUserProfile) {
      this.setData({
        canIUseGetUserProfile: true
      })
    }
  },
 
})